package com.slz3.business.module.goodsManagement.gooTypeLevel1.steward;

import com.slz3.business.module.goodsManagement.gooTypeLevel1.domain.GooTypeLevel1;
import com.slz3.business.module.goodsManagement.gooTypeLevel1.domain.GooTypeLevel1Condition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class GooTypeLevel1Response {

    @Resource
    private GooTypeLevel1ResController gooTypeLevel1ResController;

    public Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel1.class).flatMap(gooTypeLevel1 ->
                gooTypeLevel1ResController.add(req, gooTypeLevel1)
        );
    }

    public Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel1Condition.class).flatMap(gooTypeLevel1Condition ->
                gooTypeLevel1ResController.delete(req, gooTypeLevel1Condition)
        );
    }

    public Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel1.class).flatMap(gooTypeLevel1 ->
                gooTypeLevel1ResController.modify(req, gooTypeLevel1)
        );
    }


    public Mono<ServerResponse> list(ServerRequest req) {
        return gooTypeLevel1ResController.list(req);
    }

    public Mono<ServerResponse> info(ServerRequest req) {
        return gooTypeLevel1ResController.info(req);
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        return gooTypeLevel1ResController.choice(req);
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel1Condition.class).flatMap(gooTypeLevel1Condition ->
                gooTypeLevel1ResController.auditSubmit(req, gooTypeLevel1Condition)
        );
    }

    public Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel1Condition.class).flatMap(gooTypeLevel1Condition ->
                gooTypeLevel1ResController.audit(req, gooTypeLevel1Condition)
        );
    }

    public Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel1Condition.class).flatMap(gooTypeLevel1Condition ->
                gooTypeLevel1ResController.auditReject(req, gooTypeLevel1Condition)
        );
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel1Condition.class).flatMap(gooTypeLevel1Condition ->
                gooTypeLevel1ResController.usingEnable(req, gooTypeLevel1Condition)
        );
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel1Condition.class).flatMap(gooTypeLevel1Condition ->
                gooTypeLevel1ResController.usingDisable(req, gooTypeLevel1Condition)
        );
    }

}
